<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html class="x-admin-sm">
    
    <head>
    	<base href="<%=basePath%>">
        <meta charset="UTF-8">
        <title>欢迎页面-X-admin2.2</title>
        <meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="stylesheet" href="<%=basePath %>leyuiyc/css/font.css">
        <link rel="stylesheet" href="<%=basePath %>leyuiyc/css/xadmin.css">
        <script type="text/javascript" src="<%=basePath %>leyuiyc/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="<%=basePath %>leyuiyc/js/xadmin.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
            <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
            <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
	<div class="layui-fluid">
		<div class="layui-row layui-col-space15">
			<div class="layui-col-md12">
				<div class="layui-card">
					<div class="layui-card-body ">
						<table class="layui-table layui-form" id="test" lay-filter="test">
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>

	<script>
				layui.use(['table','form','slider','layedit', 'laydate', "jquery"], function(){
				  var form = layui.form
				  ,layer = layui.layer
				  ,layedit = layui.layedit
				  ,laydate = layui.laydate
				  ,slider = layui.slider
				  ,table = layui.table
				  ,$ = layui.jquery;
				  table.render({
				    elem: '#test'
				    ,url:'purchasing/selectGYS.do'
				    ,width: 'auto'
				    ,anim: 2
				    ,height: 600
				    ,method: 'post'
				  	 ,toolbar: '#toolbarDemo'
				    ,title: '订单信息表'
				    ,page: true
				    ,cols: [[
			    	   {type:'radio', fixed: 'left'}
				      ,{field:'supplierName', width:930, title: '供应商'}
				    ]]
				    ,skin: 'row' //表格风格
	                ,limits:[10,20,30,40,50]
				    ,limit: 10 //每页默认显示的数量
				  });
				  //头工具栏事件
				  table.on('toolbar(test)', function(obj){
				    var checkStatus = table.checkStatus(obj.config.id); //获取选中行状态
				    switch(obj.event){
				      case 'getCheckData':
				        var data = checkStatus.data; 
				        var brandId = data[0].supplierId;
				        var supplierName = data[0].supplierName;
				         //获取选中行数据
					      var index =  layer.open({
	    					type : 2,
	    					title : '选择供应商',
	    					maxmin : true,
	    					area : [ '1050px', '650px' ], //弹出框大小
	    					content : "purchasing/goAddTvPurchase2.do?brandId="+brandId+"&supplierName="+supplierName,
	    					end : function() {
	    					}
	    					
	    				});
				      break;
				    };
				  });
				  });
				</script>
				<script type="text/html" id="toolbarDemo">	
	            <div class="layui-btn-container">
                   <button class="layui-btn layui-btn-sm" lay-event="getCheckData">确认选择供应商</button>
                </div>
               </script>
				</body>

</html>
